// @ts-ignore
/* eslint-disable */
import { request } from "@/utils/request";

/** 获取用户列表 分页获取用户列表，支持搜索和过滤 GET /admin/users */
export async function adminUsers(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminUsersParams,
  options?: { [key: string]: any }
) {
  return request<API.PageResponse & { data?: API.User[] }>(`/admin/users`, {
    method: "GET",
    params: {
      // page has a default value: 1
      page: "1",
      // page_size has a default value: 20
      page_size: "20",

      ...params,
    },
    ...(options || {}),
  });
}

/** 创建用户 创建新用户账户 POST /admin/users */
export async function adminUsers2(
  body: API.UserCreateRequest,
  options?: { [key: string]: any }
) {
  return request<API.Response & { data?: API.User }>(`/admin/users`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取用户详情 根据用户ID获取用户详细信息 GET /admin/users/${param0} */
export async function adminUsersId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminUsersIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response & { data?: API.User }>(`/admin/users/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新用户信息 更新指定用户的信息 PUT /admin/users/${param0} */
export async function adminUsersId2(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminUsersIdParams,
  body: API.UserUpdateRequest,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response & { data?: API.User }>(`/admin/users/${param0}`, {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 软删除指定用户 DELETE /admin/users/${param0} */
export async function adminUsersId3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminUsersIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<any>(`/admin/users/${param0}`, {
    method: "DELETE",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新用户状态 启用或禁用用户账户 PUT /admin/users/${param0}/status */
export async function adminUsersIdStatus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminUsersIdStatusParams,
  body: API.UserStatusRequest,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<any>(`/admin/users/${param0}/status`, {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 搜索用户 根据关键词搜索用户 GET /admin/users/search */
export async function adminUsersSearch(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminUsersSearchParams,
  options?: { [key: string]: any }
) {
  return request<API.PageResponse & { data?: API.User[] }>(
    `/admin/users/search`,
    {
      method: "GET",
      params: {
        // page has a default value: 1
        page: "1",
        // page_size has a default value: 20
        page_size: "20",
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 获取用户统计信息 获取用户相关的统计数据 GET /admin/users/stats */
export async function adminUsersStats(options?: { [key: string]: any }) {
  return request<API.Response & { data?: any }>(`/admin/users/stats`, {
    method: "GET",
    ...(options || {}),
  });
}
